//# sourceMappingURL=file.js.map 
 var data_sale = new Array(12);
 var data_pv = new Array(12);

$.ajax({
		    type: 'POST',
		    url: "/FAFCode/StoreSalesDetails",
		    data: {"salesDetails":"1"},
		    dataType: 'json',
		    beforeSend: function () {
		        load();
		    },
		    complete: function () {
		        disLoad();
		    },
		    success: function (data) {
		    	$.each(data,function(n,item){
					data_sale[n] = item.turnover;
					data_pv[n] = item.pv;
				})
				var chart = new Highcharts.chart('container', {
				    chart: {
				        zoomType: 'xy'
				       
				    },
				    title: {
				        text: '店铺访问量以及成交量展示'
				    },
				    xAxis: [{
				        categories: ['一月', '二月', '三月', '四月', '五月', '六月',
				            '七月', '八月', '九月', '十月', '十一月', '十二月'],
				        crosshair: true
				    }],
				    yAxis: [{ // Primary yAxis
				        labels: {
				            format: '{value} 次',
				            style: {
				                color: Highcharts.getOptions().colors[1]
				            }
				        },
				        title: {
				            text: '访问量',
				            style: {
				                color: Highcharts.getOptions().colors[1]
				            }
				        }
				    }, { // Secondary yAxis
				        title: {
				            text: '成交量',
				            style: {
				                color: Highcharts.getOptions().colors[0]
				            }
				        },
				        labels: {
				            format: '{value} 单',
				            style: {
				                color: Highcharts.getOptions().colors[0]
				            }
				        },
				        opposite: true
				    }],
				    tooltip: {
				        shared: true
				    },
				    legend: {
				        layout: 'vertical',
				        align: 'left',
				        x: 120,
				        verticalAlign: 'top',
				        y: 100,
				        floating: true,
				        backgroundColor:
				            Highcharts.defaultOptions.legend.backgroundColor || // theme
				            'rgba(255,255,255,0.25)'
				    },
				    series: [{
				        name: '成交量',
				        type: 'column',
				        yAxis: 1,
				        data: [data_sale[0],data_sale[1],data_sale[2],data_sale[3],data_sale[4],data_sale[5],data_sale[6],data_sale[7],data_sale[8],data_sale[9],data_sale[10],data_sale[11]],
				        tooltip: {
				            valueSuffix: ' 单'
				        }

				    }, {
				        name: '访问量',
				        type: 'spline',
				        data: [data_pv[0], data_pv[1], data_pv[2], data_pv[3], data_pv[4], data_pv[5], data_pv[6], data_pv[7], data_pv[8], data_pv[9], data_pv[10], data_pv[11]],
				        tooltip: {
				            valueSuffix: ' 次'
				        }
				    }]
				});
		    },
		    //当商家没有登陆时
			error : function() {
				alert("请先登录！！！");
				window.location.href='/FAFCode/OrderManagement/login.html';
			}
		    	

})
//弹出加载层
function load() {
    $("<div class=\"datagrid-mask\"></div>").css({
        display: "block",
        width: "100%",
        height: $(window).height()
    }).appendTo("body");
    $("<div class=\"datagrid-mask-msg\"></div>").html("加载中，请稍候。。。").appendTo("body").css({
        display: "block",
        left: ($(document.body).outerWidth(true) - 190) / 2,
        top: ($(window).height() - 45) / 2
    });
}
//取消加载层  
function disLoad() {
    $(".datagrid-mask").remove();
    $(".datagrid-mask-msg").remove();
} 


